<template>
	<view>
		<view class="block1">
			<template v-for="item in  destinationList">
				<view class="pub_tit">
					<text>{{item.province}}</text>
				</view>
				<view class="block1_con fz_0">
					<view class="item" v-for="destina in item.subList"  @click="toNewPage('/pages/productList/productList')">
						<view class="img_box pos_r">
							<image :src="destina.destinationPic" v-if="destina.destinationPic"></image>
							<image src="../../static/test.png" v-else></image>
							<view class="tag tag1"></view>
						</view>
						<view class="text"><view class="info">{{destina.city}}</view></view>
					</view>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	import util from '../../common/util.js'
	export default {
		data() {
			return {
				destinationList:[]
			}
		},
		onShow() {
			this.getdestinations()
		},
		methods: {
			toNewPage(url) {
				uni.navigateTo({url});
			},
			getdestinations(){
				uni.showLoading({
					mask:true,
					title: '加载中'
				});
				var that = this
				util.fetchPost('/destination/listAll',{},function(res){
					that.destinationList = res.data	
					uni.hideLoading();
				},function(){},false)	
			}
		}
	}
</script>

<style>
	.block1 {
		padding: 0 10upx;
	}
	
	.block1 .pub_tit {
		margin-left: 15upx;
	}
	
	.block1_con .item {
		display: inline-block;
		vertical-align: top;
		margin-bottom: 20upx;
		width: 33.33%;
		text-align: center;
	}
	
	.block1_con .item .img_box {
		display: inline-block;
	}

	.block1_con .item .img_box image {
		width: 220upx;
		height: 220upx;
		border-radius: 14upx;
	}

	.block1_con .item .img_box .tag {
		background: url() no-repeat center/cover;
		width: 94upx;
		height: 31upx;
		position: absolute;
		top: 0;
		left: 0;
	}

	.block1_con .item .img_box .tag2 {
		background-image: url();
	}

	.block1_con .item .img_box .tag3 {
		background-image: url();
	}

	.block1_con .item .text {
		font-size: 28upx;
		color: #434443;
		line-height: 70upx;
		text-align: center;
	}

	.block1_con .item .text .info {
		font-size: 24upx;
		color: #C1C1C1;
		margin-top: 8upx;
		
	}
</style>
